home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / var / lib / dpkg / info / makedev.preinst < prev    next >
Text File  |  2008-05-09  |  926b  |  35 lines

  1. #!/bin/sh
  2.  
  3. # Remove a no-longer used conffile
  4. rm_conffile() {
  5.     PKGNAME="$1"
  6.     CONFFILE="$2"
  7.     if [ -e "$CONFFILE" ]; then
  8.         md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
  9.         old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE'{s/ obsolete$//;s/.* //p}\"`"
  10.         if [ "$md5sum" != "$old_md5sum" ]; then
  11.             echo "Obsolete conffile $CONFFILE has been modified by you."
  12.             echo "Saving as $CONFFILE.dpkg-old ..."
  13.             mv -f "$CONFFILE" "$CONFFILE".dpkg-old
  14.         else
  15.             echo "Removing obsolete conffile $CONFFILE ..."
  16.             rm -f "$CONFFILE"
  17.         fi
  18.     fi
  19. }
  20.  
  21. case "$1" in
  22. install|upgrade)
  23.     if dpkg --compare-versions "$2" le "2.3.1-87"; then
  24.     rm_conffile makedev /etc/init.d/makedev
  25.     update-rc.d makedev remove
  26.     fi
  27. esac
  28.  
  29. rm -f /usr/man/man8/MAKEDEV.8 /usr/man/man8/MAKEDEV-C.8 \
  30.     /usr/man/man8/MAKEDEV-C.8.gz
  31.  
  32.  
  33.  
  34. exit 0
  35.